package vista;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

import javax.swing.WindowConstants;
import javax.swing.border.LineBorder;
import javax.swing.SwingUtilities;

import vista.VentanaArbitro;
import vista.VentanaEquipo;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VentanaPrincipal extends javax.swing.JFrame {
	private JPanel panPrincipal;
	private AbstractAction absPartidos;
	private JPanel panOpciones;
	private JButton btnSalir;
	private JButton btnGenerar;
	private JLabel lblIndicaciones;
	private JButton btnTabla;
	private JButton btnCalendario;
	private JButton btnRegistrarEq;
	private JButton btnRegistrarArb;
	private VentanaArbitro miVarbitro;


	
	
	public VentanaPrincipal() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			this.miVarbitro = new VentanaArbitro();
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setTitle("Bienvenido a la Liga");
			this.setPreferredSize(new java.awt.Dimension(553, 419));
			{
				panPrincipal = new JPanel();
				getContentPane().add(panPrincipal, BorderLayout.NORTH);
				panPrincipal.setLayout(null);
				panPrincipal.setPreferredSize(new java.awt.Dimension(558, 365));
				panPrincipal.setToolTipText("Presione Aquí para hacer un Registro");
				{
					lblIndicaciones = new JLabel();
					panPrincipal.add(lblIndicaciones);
					panPrincipal.add(getPanOpciones());
					lblIndicaciones.setBounds(51, 339, 461, 15);
				}
			}
			pack();
			this.setSize(553, 419);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

	private JButton getBtnGenerar() {
		if(btnGenerar == null) {
			btnGenerar = new JButton();
			btnGenerar.setText("Generar Partidos");
			btnGenerar.setBounds(12, 123, 215, 50);
		}
		return btnGenerar;
	}
	
	private JButton getBtnSalir() {
		if(btnSalir == null) {
			btnSalir = new JButton();
			btnSalir.setText("Salir");
			btnSalir.setBounds(12, 266, 215, 46);
		}
		return btnSalir;
	}
	
	private JPanel getPanOpciones() {
		if(panOpciones == null) {
			panOpciones = new JPanel();
			panOpciones.setBounds(294, 25, 243, 323);
			panOpciones.setLayout(null);
			panOpciones.add(getBtnGenerar());
			panOpciones.add(getBtnSalir());
			panOpciones.add(getBtnRegistrarArb());
			panOpciones.add(getBtnRegistrarEq());
			panOpciones.add(getBtnCalendario());
			panOpciones.add(getBtnTabla());
		}
		return panOpciones;
	}
	public void agregarListener(ActionListener accion){
		btnRegistrarArb.addActionListener(accion);
		btnRegistrarEq.addActionListener(accion);
		btnGenerar.addActionListener(accion);
		btnCalendario.addActionListener(accion);
		btnTabla.addActionListener(accion);
		btnSalir.addActionListener(accion);
	}
	
	private JButton getBtnRegistrarArb() {
		if(btnRegistrarArb == null) {
			btnRegistrarArb = new JButton();
			btnRegistrarArb.setText("Registrar Arbitro");
			btnRegistrarArb.setBounds(12, 27, 215, 50);
		}
		return btnRegistrarArb;
	}
	
	private JButton getBtnRegistrarEq() {
		if(btnRegistrarEq == null) {
			btnRegistrarEq = new JButton();
			btnRegistrarEq.setText("Registrar Equipo");
			btnRegistrarEq.setBounds(12, 75, 215, 50);
		}
		return btnRegistrarEq;
	}
	
	private JButton getBtnCalendario() {
		if(btnCalendario == null) {
			btnCalendario = new JButton();
			btnCalendario.setText("Calendario");
			btnCalendario.setBounds(12, 172, 215, 51);
		}
		return btnCalendario;
	}
	
	private JButton getBtnTabla() {
		if(btnTabla == null) {
			btnTabla = new JButton();
			btnTabla.setText("Tabla de Posiciones");
			btnTabla.setBounds(12, 221, 215, 46);
		}
		return btnTabla;
	}
	public void mostrarMensaje(String mensaje){
		JOptionPane.showMessageDialog(this, mensaje);
	}
}
